package com.sevens.service.impl;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sevens.dao.FlightDao;
import com.sevens.service.FlightService;
import com.sevens.service.NewsService;
import com.sevens.vo.Flight;


public class FlightServiceImpl implements FlightService {

	private static final Logger log = LoggerFactory.getLogger(FlightServiceImpl.class);
	
private FlightDao flightDao;
	
	public FlightDao getFlightDao() {
		return flightDao;
	}
	public void setFlightDao(FlightDao flightDao) {
		this.flightDao = flightDao;
	}
	public static Logger getLog() {
		return log;
	}
	public List<Flight> searchFlight(String flightType,String flightNumber,String origin,String destination,String airline){
		List<Flight> flights = null;
		flights = flightDao.searchFlight(flightType,flightNumber,origin,destination,airline);		
		return flights;
	}
	public boolean createFlight(Flight flight){
		boolean result = flightDao.createFlight(flight);		
		return result;
	}
	
	public boolean updateFlightById(Flight flight){
		boolean result = flightDao.updateFlightById(flight);		
		return result;
	}
	
	public boolean deleteFlightById(Flight flight){
		boolean result = flightDao.deleteFlightById(flight);		
		return result;
	}
	
	public List<Flight> listInArFlight(){
		List<Flight> flights = null;
		flights = flightDao.listInArFlight();
		
		return flights;
	}
	
	public List<Flight> listInDeFlight(){
		List<Flight> flights = null;
		flights = flightDao.listInDeFlight();
		
		return flights;
	}
	
	public List<Flight> listOuArFlight(){
		List<Flight> flights = null;
		flights = flightDao.listOuArFlight();
		
		return flights;
	}
	
	public List<Flight> listOuDeFlight(){
		List<Flight> flights = null;
		flights = flightDao.listOuDeFlight();
		
		return flights;
	}
	public List<Flight> getAllFlights(){
		List<Flight> flights = null;
		flights = flightDao.getAllFlights();
		
		return flights;
	}
	public Flight getFlightByFlightID(int flightId){
		Flight flight = null;
		flight = flightDao.getFlightByFlightID(flightId);
		return flight;
	}
}

